package com.example.user.feign;

import com.example.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author heshao
 * @date 2021/1/11 17:44
 */
@FeignClient(value = "user-service", fallback = UserClientFallback.class)
public interface UserClient {

    String API_PREFIX = "/user";

    /**
     * 获取用户信息
     *
     * @param id 用户id
     * @return
     */
    @GetMapping(API_PREFIX + "/{id}")
    User userInfo(@PathVariable Long id);
}
